package cn.getech.data.development.service.impl;

import cn.getech.data.development.entity.AllPermissionConfig;
import cn.getech.data.development.mapper.AllPermissionConfigMapper;
import cn.getech.data.development.service.IAllPermissionConfigService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 安全全局配置 服务实现类
 * </p>
 *
 * @author nxy
 * @since 2019-12-18
 */
@Service
public class AllPermissionConfigServiceImpl extends ServiceImpl<AllPermissionConfigMapper, AllPermissionConfig> implements IAllPermissionConfigService {

    @Autowired
    private AllPermissionConfigMapper allPermissionConfigMapper;

    @Override
    public AllPermissionConfig getConfigByPermissType(int permissType){
        QueryWrapper<AllPermissionConfig> queryWrapper = new QueryWrapper<>();
        AllPermissionConfig allPermissionConfig = baseMapper.selectOne(queryWrapper.eq("permiss_type",permissType));
        return allPermissionConfig;
    }

    @Override
    public AllPermissionConfig selectOneByType(int premissType) {
        return allPermissionConfigMapper.selectOneByType(premissType);
    }
}
